1. Technical Field
The invention generally relates to displaying digital documents, and in particular to layout of content such as text for display on client devices.
2. Background Information
Rendering content within an application can be a challenging task. For example, when rendering text or other components of content of a digital book, the text must be appropriately split into words and lines based on the length of the individual words and on the font, spacing, and other textual properties. Further, the appropriate portion of the text must be displayed within the current visible region of the application's text area, which may in turn depend on the current size of the application window. Thus, many application developers rely on an existing layout engine provided by the operating system or by a third party to handle the layout of application content. Examples of such layout engines include WEBKIT, KHTML, Gecko, and the like.
However, layout engines often merely render the content provided to them as input by the developers, without providing any mechanism to determine the positions where the various components of the content, such as individual words of text, were rendered by the layout engine. Nor is it a simple matter for application developers to compute such positions themselves, since the layout algorithms used by the layout engines are often complex, taking into account a large number of variables. Such layout position information would often be of value to application developers for performing a number of useful tasks, such as performing additional rendering not performed by the layout engine itself (e.g., adding highlights to individual words), scrolling to the appropriate page in response to a search for text of interest, and the like. However, without the ability to obtain layout position information for the various content components of interest, it is completely impractical to perform these useful tasks.